// 	Name: 08.c
//	Description: Chapter 6 project 8
//	Author: StableGenius
//	Date: 2020-07-09
//	Email: feng@dongfa.pro

#include <stdio.h>

int main(void) {
	int total_days, starting_day;

	printf("Enter number of days in month: ");
	scanf("%d", &total_days);

	printf("Enter starting day of the week (1=Sun, 7=Sat): ");
	scanf("%d", &starting_day);
	printf("\n");

	for (int i = 1; i < starting_day; i++)
	{
		printf("   ");
	}

	for (int i = 1; i <= total_days; i++)
	{
		printf("%3d", i);

		if ((i + starting_day - 1) % 7 == 0) {
			printf("\n");
		}
	}

    printf("\n");

	return 0;
}
